﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IPC.Communication.Core.IMessage;

namespace IPC.Communication.Profinet.Geniitek
{
    public class VibrationSensorLongMessage : INetMessage
    {
        public int ProtocolHeadBytesLength
        {
            get
            {
                return 12;
            }
        }

        public byte[] HeadBytes
        {
            get;
            set;
        }

        public byte[] ContentBytes
        {
            get;
            set;
        }

        public byte[] SendBytes
        {
            get;
            set;
        }

        public bool CheckHeadBytesLegal(byte[] token)
        {
            if (HeadBytes == null)
            {
                return false;
            }
            if (HeadBytes[0] == 170 && HeadBytes[1] == 85 && HeadBytes[2] == 127)
            {
                return true;
            }
            return false;
        }

        public int GetContentLengthByHeadBytes()
        {
            return HeadBytes[10] * 256 + HeadBytes[11] + 4;
        }

        public int GetHeadBytesIdentity()
        {
            return 0;
        }
    }
}
